typedef void (*Callback)(void* data);

typedef struct {
    Callback callbacks[10];
    int count;
} Subject;

void subject_add_observer(Subject* s, Callback cb) {
    s->callbacks[s->count++] = cb;
}

void subject_notify(Subject* s, void* data) {
    for (int i = 0; i < s->count; i++) {
        s->callbacks[i](data);
    }
}